package com.tf.temper.entity;

/**
 * 
 *
 * @date 2020-09-15 09:52:39
 */
public class SyfaceReturnEntity<Entity>
{
	private Entity ret;
	private String desc;
	private int openDoor;
	private  int unlockDelay;

	public SyfaceReturnEntity()
	{
		this.desc = "Success";
		this.openDoor = 0;
		this.unlockDelay = 0;
	}

	public SyfaceReturnEntity(Entity ret,String desc,int openDoor,int unlockDelay) {
		this.ret = ret;
		this.desc = desc;
		this.openDoor = openDoor;
		this.unlockDelay = unlockDelay;
	}

	public SyfaceReturnEntity(Entity entity) {
		this();
		this.ret = entity;
	}

	public SyfaceReturnEntity<Entity> ok(Entity entity,int openDoor,int unlockDelay) {
		this.ret = entity;
		this.openDoor = openDoor;
		this.unlockDelay = unlockDelay;
		return this;
	}

	public SyfaceReturnEntity<Entity> ok() {
		return this;
	}

	public SyfaceReturnEntity<Entity> error(String desc,int unlockDelay) {
		return new SyfaceReturnEntity("500", desc,0,unlockDelay);
	}

	public SyfaceReturnEntity<Entity> errorLogic(String desc,int unlockDelay) {
		return new SyfaceReturnEntity("1", desc,0,unlockDelay);
	}

	public SyfaceReturnEntity<Entity> put(Entity entity) {
		this.ret = entity;
		return this;
	}

	public Entity getRet() {
		return this.ret;
	}

	public String getDesc() {
		return this.desc;
	}

	public void setRet(Entity ret) {
		this.ret = ret;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public int getOpenDoor() {
		return openDoor;
	}

	public void setOpenDoor(int openDoor) {
		this.openDoor = openDoor;
	}

	public int getUnlockDelay() {
		return unlockDelay;
	}

	public void setUnlockDelay(int unlockDelay) {
		this.unlockDelay = unlockDelay;
	}
}
